alter proc sp_getResourceTotalInProducing
@resource_id int
as
select sum(isnull(supply_kg,0)-isnull(usage,0)) as total
from dbo.v_Storage_InProducing
where supply_unit_kg>usage and resource_Id=@resource_id
